package com.example.demo;

import org.springframework.beans.BeansException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

@SpringBootApplication
public class DemoApplication implements ApplicationContextAware {
    private static ApplicationContext applicationContext;
    public static void main(String[] args) {

        SpringApplication.run(DemoApplication.class, args);
        System.out.println("启动成功！");
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContextParam) throws BeansException {
        applicationContext = applicationContextParam;
    }
}
